package com.zhibang.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhibang.dto.AccountxtzhDTO;
import com.zhibang.entity.Account;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
* @author lewin
* @description 针对表【account(账号表)】的数据库操作Mapper
* @createDate 2025-03-05 09:18:16
* @Entity com.zhibang.entity.Account
*/
public interface AccountMapper extends BaseMapper<Account> {

    /*根据用户名获取对象*/
    Account getUsers(String yhm);
    /*根据用户名获取角色*/
    List<String> getRoles(String yhm);
    //selectAccountInfo
    IPage<AccountxtzhDTO> selectAccountInfo(@Param("query") AccountxtzhDTO query, IPage page);
    //根据id查询getAccountById
//    AccountxtzhDTO getAccountById2(@Param("id") Integer id);

    @Update("update account set name = #{name}, phone=#{phone} where id = #{id}")
    int updateAccount(Account account);
    @Select("select id, name, phone from account where id = #{id}")
    Account getAccountById(Integer id);
}




